package com.zhihuitong.meeting.base;

import android.os.Bundle;
import android.support.annotation.Nullable;

/**
 * 作者： guoyuan
 * 时间 2020/2/22.
 * 文件描述：
 * 版本号：V 1.0
 **/
public abstract class BaseMVPActivity<T extends BasePresenter> extends BaseActivity {
    protected T mPresenter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPresenter = createPresenter();
    }

    /**
     * MVP模式下創建Presenter 必須實現
     *
     * @return
     */
    protected abstract T createPresenter();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mPresenter != null) {
            mPresenter.detailView();
        }
    }
}
